import request from '@/router/axios'

//  分页获取商品类别
export function fetchCtgList(query) {
  return request({
    url: '/eims/ctg/page',
    method: 'get',
    params: query
  })
}

//  列表获取商品类别
export function getCtgList() {
  return request({
    url: '/eims/ctg/list',
    method: 'get'
  })
}

export function addCtgObj(obj) {
  return request({
    url: '/eims/ctg',
    method: 'post',
    data: obj
  })
}

export function getCtgObj(id) {
  return request({
    url: '/eims/ctg/' + id,
    method: 'get'
  })
}

export function delCtgObj(id) {
  return request({
    url: '/eims/ctg/' + id,
    method: 'delete'
  })
}

export function putCtgObj(obj) {
  return request({
    url: '/eims/ctg',
    method: 'put',
    data: obj
  })
}

// 查询销售商品类别列表
export function fetchCtgSaleList(query) {
  return request({
    url: '/eims/ctgsale/list',
    method: 'get',
    params: query
  })
}

// 查询所有销售商品类别列表
export function getSaleCtgList() {
  return request({
    url: '/eims/ctgsale/getList',
    method: 'get',
  })
}


export function getSaleCtgInfo(id) {
  return request({
    url: '/eims/ctgsale/' + id,
    method: 'get'
  })
}